A storage system that uses flash memory as a storage medium instead of a hard disk is conceivable. A flash memory (for example, a NAND flash memory) is configured from a plurality of flash memory chips (called flash chips below). Each flash chip is configured from a plurality of physical blocks.
The flash memory is advantageous in that it is capable of operating at higher speeds and consumes less power than the hard disk. However, by contrast, it also has the following limitations.
First is the fact that the updating of each bit of memory is limited to one direction, i.e., from 1 to 0 (or from 0 to 1). In a case where a reverse update is required, an erase process, in which all the cell bits configuring the physical block are set to 1 (or 0), must be carried out for a physical block.
Second, the erase count per physical block is limited. For example, in the case of a NAND flash memory, the limit of the erase count per physical block is between around 10,000 and 100,000.
For the above reasons, in a case where a flash memory is used instead of a hard disk as the storage medium in a storage system, there is the concern that the bias of the rewrite frequency for each physical block will result in only some of the physical blocks reaching the erase count limit and becoming unusable. For example, in an ordinary file system, since the rewrite frequency to a logical block allocated to either a directory or an i-node is higher than the rewrite frequency to another logical block, it is highly likely that the erase count for the physical block allocated to the logical block that has been allocated to either the directory or the i-node will reach the limit.
With regard to this problem, as shown in Patent Literature 1, technology for extending the service life of a storage apparatus by allocating a physical block (an alternate block) that will serve as an alternate for the physical block (the bad block) that has become unusable is known.
Further, as shown in Patent Literature 2, technology (wear-leveling) for leveling the erase counts of the physical blocks by dynamically changing the logical/physical mapping (for example, the corresponding relationship between a logical block and a physical block) is also known. Wear-leveling algorithms include dynamic wear-leveling and static wear-leveling. Dynamic wear-leveling is the migrating of data as much as possible to a free block with a low erase count when erasing a physical block in line with a data update. In static wear-leveling, data that is not to be updated (static data) may also become the target of a migration.